<template>
    <div id="owleditbox" ref="box">
      <textarea v-model="edithContent">

      </textarea>
      <br>
      <div style="width: 100%;display: flex">
        <div class="btn" @click="toggle">X</div>
        <div class="btn2" @click="sendComment">发送</div>

      </div>
    </div>
</template>

<script>
    export default {
        name: "owlEditBox",
      data(){


          return{
            flag:false,
            edithContent:"",
          }
      },

      methods:{


          toggle(){

            if(!this.flag) {
              this.$refs.box.style.height = "200px";
            }else {

              this.$refs.box.style.height = "0px";
              this.$parent.show();

            }
            this.flag=!this.flag;
          },
        sendComment(){


            if(this.edithContent.length>0){

             // 发送评论

              this.edithContent="";



            }
        }
      }
    }
</script>

<style scoped>

  #owleditbox{

    width: 100%;
    overflow: hidden;
    height: 0px;
    /*background-color: aquamarine;*/
    position: absolute;
  }

  textarea {

    width: 80%;
    height: 90px;
    background-color: rgba(0,0,0,0);
    outline: none;
    border: 1px solid white;
    border-radius: 4px;
    margin-top: 12px;
    color: white;
    padding: 8px;
    font-size: 16px;


  }
  .btn{

    margin-top: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: red;
    display: block;
    margin-left: calc(50% - 65px);
    margin-right: 8px;
    color: white;
    line-height: 40px;

  }

  .btn:active{
    opacity: 0.6;
  }

  .btn2{

    margin-top: 12px;
    width: 90px;
    height: 40px;
    border-radius: 20px;
    background-color: dodgerblue;
    display: block;
    margin-left: 8px;
    margin-right: 8px;
    color: white;
    line-height: 40px;
  }
  .btn2:active{

    opacity: 0.6;
  }

</style>
